<?php
class Staff_type_model extends Mymodel {
	public $table_name = "staff_type";
    function Staff_type_model()
    {
        parent::Mymodel();
    }
	
	function get_type($id=NULL)
	{
		return $this->get_data($this->table_name, $id);
	}
	
	function insert_new_type($data)
	{
		return $this->insert_new_record($this->table_name , $data);
	}
	
	function update_type_by_id($data, $id)
	{
		return $this->update_by_id($this->table_name, $data, $id);
	}	
	function delete_type_by_id($id)
	{
		$is_user_connected = $this->check_by_col('user' , 'type_id' , $id);
		if($is_user_connected > 0)
			return false;
		else
			return $this->delete_by_id($this->table_name , $id);
	}
}
